<article class="module width_full">
    <header><h3>{#reports#}</h3></header>
	<table width="100%" cellpadding="3" cellspacing="1">
		<tbody><tr>
		<td class="header" style="font-weight:bold;">{#new_reports#}</td>
		</tr>
	</tbody></table>
	<table width="100%" cellpadding="3" cellspacing="1">
		<tr>
			<th align="center" class="header">{#username#}</th>
			<th align="center" class="header">{#report#}</th>
			<th align="center" class="header">{#title#}</th>
			<th align="center" class="header">{#date#}</th>
			<th align="right" class="header">{#action#}</th>
		</tr>
                {if !empty($new_value)}
                    {foreach from=$new_value item=item}
                            {literal}
                            <script type="text/javascript">
                                    $(function() {
                                            $(".inv_button_new_{/literal}{$item.id}{literal}").click(function() {
                                                    var id 					= '{/literal}{$item.id}{literal}';
                                                    var dataString	= 'report='+ id;
                                                    var parent = $(this).parent();
                                            $.ajax({
                                                    type: "POST",
                                                    url: "_javascript/ajax_livedit.php",
                                                    data: dataString,
                                                    cache: false,
                                                    success: function()
                                                            {
                                                                    $("#maininv_new_{/literal}{$item.id}{literal}").fadeOut('slow', function() {$("#maininv_new_{/literal}{$item.id}{literal}").remove();});
                                                            }
                                            });
                                            return false;
                                            });
                                    });
                            </script>
                            {/literal}
                            <tr id="maininv_new_{$item.id}">
                                    <td align="center" class="body"><a style="font-weight:bold; color:#000000;" href="index.php?mod=profile&userID={$item.userID}">{$item.username}</a></td>
                                    <td align="center" class="body"><a style="font-weight:bold; color:#000000;" href="index.php?mod=profile&userID={$item.reportID}">{$item.report}</a></td>
                                    <td align="center" class="body">{$item.timestamp}</td>
                                    <td align="center" class="body">{$item.title}</td>
                                    <td align="right" class="body"><a href="index.php?mod=report&page=detail&id={$item.id}"><img src="_images/icons/magnifier.png" /></a><a href="" class="inv_button_new_{$item.id}"><img src="_images/icons/cross.png" alt=""></a></td>
                            </tr>
                    {/foreach}
                {/if}
	</table>
		
	<table width="100%" cellpadding="3" cellspacing="1">
		<tbody><tr>
		<td class="header" style="font-weight:bold;">{#old_reports#}</td>
		</tr>
	</tbody></table>
	<table width="100%" cellpadding="3" cellspacing="1">
		<tr>
			<th align="center" class="header">{#username#}</th>
			<th align="center" class="header">{#report#}</th>
			<th align="center" class="header">{#title#}</th>
			<th align="center" class="header">{#date#}</th>
			<th align="right" class="header">{#action#}</th>
		</tr>
                {if !empty($old_value)}
                    {foreach from=$old_value item=item}
                            {literal}
                            <script type="text/javascript">
                                    $(function() {
                                            $(".inv_button_old_{/literal}{$item.id}{literal}").click(function() {
                                                    var id 					= '{/literal}{$item.id}{literal}';
                                                    var dataString	= 'report='+ id;
                                                    var parent = $(this).parent();
                                            $.ajax({
                                                    type: "POST",
                                                    url: "_javascript/ajax_livedit.php",
                                                    data: dataString,
                                                    cache: false,
                                                    success: function()
                                                            {
                                                                    $("#maininv_old_{/literal}{$item.id}{literal}").fadeOut('slow', function() {$("#maininv_old_{/literal}{$item.id}{literal}").remove();});
                                                            }
                                            });
                                            return false;
                                            });
                                    });
                            </script>
                            {/literal}
                            <tr id="maininv_old_{$item.id}">
                                    <td align="center" class="body"><a style="font-weight:bold; color:#000000;" href="index.php?mod=profile&userID={$item.userID}">{$item.username}</a></td>
                                    <td align="center" class="body"><a style="font-weight:bold; color:#000000;" href="index.php?mod=profile&userID={$item.reportID}">{$item.report}</a></td>
                                    <td align="center" class="body">{$item.timestamp}</td>
                                    <td align="center" class="body">{$item.title}</td>
                                    <td align="right" class="body"><a href="index.php?mod=report&page=detail&id={$item.id}"><img src="_images/icons/magnifier.png" /></a><a href="" class="inv_button_old_{$item.id}"><img src="_images/icons/cross.png" alt=""></a></td>
                            </tr>
                    {/foreach}
                {/if}
	</table>

</article>